//
// Created by 王书哲 on 25-3-18.
//使用外部变量 global.c
//
#include <stdio.h>
int units = 0;//定义式声明
void critic(void);
int main(void)
{
    extern int units; //可选的重复声明 extern 告诉程序当前变量是引用同一个定义在函数外部的变量(具有文件作用域、外部链接和静态存储期)
    printf("How many pounds to a firkin of butter?\n");
    scanf("%d", &units);
    while (units != 56) {
        critic();
    }
    printf("You must have looked it up!\n");
    return 0;
}
void critic(void)
{
    //删除可选的重复声明
    printf("No luck, my friend. Try again.\n");
    scanf("%d", &units);
}
